
#template for shading
#shading for Democrat president years (1892-2007)
#    1893-96
#    1913-1920
#    1933-1952
#    1961-1968
#    1977-1980
#    1993-2000


#add shading for years in which president was democrat
shade.color = "gray80"
polygon(x=c(1893, 1893, 1896, 1896),
    y=par()$usr[c(3,4,4,3)],
    col= shade.color,   ## desired color
    border=F)
polygon(x=c(1913, 1913, 1920, 1920),
    y=par()$usr[c(3,4,4,3)],
    col= shade.color,   ## desired color
    border=F)         ## no border
polygon(x=c(1933, 1933, 1952, 1952),
    y=par()$usr[c(3,4,4,3)],
    col= shade.color,   ## desired color
    border=F)         ## no border
polygon(x=c(1961, 1961, 1968, 1968),
    y=par()$usr[c(3,4,4,3)],
    col= shade.color,   ## desired color
    border=F)         ## no border    
polygon(x=c(1977, 1977, 1980, 1980),
    y=par()$usr[c(3,4,4,3)],
    col= shade.color,   ## desired color
    border=F)         ## no border    
polygon(x=c(1993, 1993, 2000, 2000),
    y=par()$usr[c(3,4,4,3)],
    col= shade.color,   ## desired color
    border=F)         ## no border 
